$top: 40px;
$left: 5px;

$sizes: (320: 568,
360: 640,
370: 640,
375: 812,
412: 732,
414: 736,
768: 1024) !default;

@import 'scrollbar';

@mixin size($width, $height) {
    &.mobile-#{$width} {
        width: $width + $left * 2;
        height: $height + $top * 2;
        padding: $top $left;
        background: #47f;
        border-radius: 20px;

        &.rotate {
            height: $width + $left * 2;
            width: $height + $top * 2;
            padding: $left $top;
        }
    }
}

* {
    padding: 0;
    margin: 0;
}

.navbar {
    font-size: 1.5rem;

    >li {
        list-style: none;
        display: inline-block;
        width: 3rem;
        padding: 5px 10px;

        .active {
            >a {
                color: #fff;
                background: #454545;
            }
        }

        .down {
            display: none;
            position: absolute;
            border: 1px solid #767766;
            background: #fff;
            color: #333;
            z-index: 9999;

            >li {
                border-bottom: 1px solid #767766;
                padding: 0 5px 0 30px;
                position: relative;
                cursor: pointer;

                &:hover {
                    color: #fff;
                    background: #7e8;
                }

                i {
                    margin-right: 1rem;
                    position: absolute;
                    left: 10px;
                    line-height: 30px;
                }
            }
        }

        &.open {
            .down {
                display: block;
            }
        }

        >div,
        >a {
            text-align: center;
            text-decoration: none;
            color: #fff;

            span {
                display: block;
                font-size: 0.7rem;
            }
        }
    }

    &.min {
        >li {
            >div {
                span {
                    display: none;
                }
            }
        }
    }
}

.top-nav {
    background: #767766;
    color: #fff;

    .navbar {
        font-size: 1.5rem;
    }
}

#page-box {
    position: relative;
}

.rule-box {
    .top-rule {
        top: 0;
        left: 0;
        right: 0;
        position: absolute;
        height: 20px;
        width: 100%;
        background-color: #ccc;
    }
    .left-rule {
        width: 20px;
        top: 0;
        left: 0;
        bottom: 0;
        position: absolute;
        height: 100%;
        background-color: #ccc;
    }
    .rule-tools {
        position: fixed;
        bottom: 0;
        line-height: 50px;
        font-size: 30px;
        background: #fff;
        border: 1px solid #ccc;
        left: 50%;
        margin-left: -90px;
        i {
            cursor: pointer;
        }
    }
    .rule-lines {
        .h-line,
        .v-line {
            border-top: 1px dotted #47f;
            border-right: 1px dotted #47f;
            position: absolute;
        }
        .h-line {
            cursor: n-resize;
            width: 100%;
            height: 1px;
        }
        .v-line {
            cursor: ew-resize;
            width: 1px;
            top: 0;
            bottom: 0;
        }
    }
}

#mainMobile {
    border: 1px solid #767676;
    margin: 0 auto;
    position: relative;
    bottom: 0;
    top: 0;
    min-height: 500px;
    background-color: #fcc;
    padding: 20px 0 0 20px;
    .top-rule {
        top: 0;
        left: 0;
        right: 0;
        position: absolute;
        height: 20px;
        width: 100%;
        background-color: #ccc;
    }
    .left-rule {
        width: 20px;
        top: 0;
        left: 0;
        bottom: 0;
        position: absolute;
        height: 100%;
        background-color: #ccc;
    }
    .rule-box {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    #mainGrid {
        width: 100%;
        height: 100%;
        overflow: auto;
        background: #fff;

        &.preview {
            .row {
                min-height: auto;
            }

            .weight-edit-grid {
                .weight-action {
                    display: none;
                }
            }
        }

        &::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        &::-webkit-scrollbar-track {
            //background-color:#eee;
            -webkit-border-radius: 2em;
            -moz-border-radius: 2em;
            border-radius: 2em;
        }

        &::-webkit-scrollbar-thumb {
            background-color: #aaa;
            -webkit-border-radius: 2em;
            -moz-border-radius: 2em;
            border-radius: 2em;
        }
    }

    @each $width,
    $height in $sizes {
        @include size($width, $height)
    }
}



.ui-draggable-dragging {

    .action,
    .view {
        display: block;
    }

}

.panel-group {
    position: absolute;
    top: 0;
    left: 0;
    width: 15rem;
    bottom: 0;
    z-index: 99;
    .panel-item {
        background: #fff;
        border: 1px solid #7e8;
        position: absolute;
        top: 0;
        left: 1rem;
        width: 14rem;
        bottom: 0;
        z-index: 100;

        .panel-header {
            background: #7e8;
            color: #fff;
            font-size: 1.5rem;
            line-height: 2rem;

            .fa-close {
                float: right;
            }
        }

        .panel-body {
            //position: relative;
            overflow-y: auto;

            .grid {
                z-index: 100;
            }
        }
        &.min {
            position: static;
            width: 1rem;
            margin-bottom: 5px;
            .panel-header {
                position: static;
                font-size: 12px;
                .fa-close {
                    display: none;
                }
            }
            .panel-body {
                display: none;
            }
        }
    }

    .weight-edit-grid {
        cursor: pointer;
        display: inline-block;
        text-align: center;
        margin: 1px 3px;

        &:hover {
            border: 1px solid #6a4;
            color: #7e8;
        }

        .weight-preview {
            .thumb {
                width: 3rem;
                height: 3rem;
                line-height: 3rem;
                text-align: center;
                .fa {
                    font-size: 3rem;
                }
            }
        }

        .weight-action,
        .weight-view {
            display: none;
        }
    }
    .tab-box {
        .tab-header {
            background: #efefef;
            .tab-item {
                width: 4.5rem;
            }
        }
        .tab-body {
            overflow-y: auto;
            @include scrollbar();
        }
    }
    .style-item {
        line-height: 60px;
        border: 1px dotted red;
        text-align: center;
        color: #999;
        font-weight: bold;
        font-size: 20px;
        img {
            width: 100%;
        }
        &.active {
            border: 1px dotted green;
        }
        &:hover {
            border-style: solid;
        }
    }
    .form-table {
        .input-group {
            >label {
                font-size: 12px;
                padding: 0;
            }
            input[type="text"],
            select {
                min-width: 40px;
            }
        }
    }
    .side-input {
        position: relative;
        height: 100px;
        >input,
        >.check-label {
            position: absolute;
            text-align: center;
            &:nth-of-type(1) {
                top: 0;
                left: 30px;
            }
            &:nth-of-type(2) {
                top: 30px;
                left: 60px;
            }
            &:nth-of-type(3) {
                top: 60px;
                left: 30px;
            }
            &:nth-of-type(4) {
                top: 30px;
                left: 0px;
            }
        }
    }
}

.expand-box {
    .expand-header {
        background: #efefef;
        font-size: 1.3rem;
        line-height: 30px;

        .fa {
            float: right;
        }
    }

    .expand-body {
        display: none;
    }

    &.open {
        .expand-header {
            .fa {
                transform: rotate(180deg);
            }
        }

        .expand-body {
            display: block;
        }
    }
}

.card {
    width: 150px;
    height: 200px;
    float: left;
    margin: 5px;
    position: relative;
    border: 1px solid;
    overflow: hidden;

    .card-logo {
        img {
            width: 150px;
            height: 200px;
        }
    }

    .card-body {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        min-height: 80px;
        background: rgba(255, 255, 255, .6);

        h3 {
            text-align: center;
        }
    }

    .card-action {
        display: none;
        position: absolute;
        top: 0;
        right: 0;
    }

    &.card-add {
        .card-logo {
            border-radius: 50%;
            border: 1px solid rgba(0, 0, 0, .1);
            width: 100px;
            height: 100px;
            margin: 50px auto 0;
            text-align: center;
            font-size: 75px;
        }

        &:hover {
            .card-logo {
                border: 1px solid rgba(56, 243, 250, 0.1);
                color: #fcc;
            }
        }
    }

    &:hover {
        border: 1px solid burlywood;

        .card-body {
            background: rgba(255, 255, 255, .8);
        }
        .card-action {
            display: block;
        }
    }
}

.theme-select,
.page-select {
    .theme-item,
    .page-item {
        display: inline-block;
        text-align: center;
        margin: 5px;
        .thumb {
            height: 80px;
            width: 80px;
            img {
                width: 100%;
                height: 100%;
            }
        }
        &.active {
            border: 1px solid red;
        }
        &:hover {
            box-shadow: 3px 3px 4px rgba(33,33,33,.7);
        }
    }
}
.theme-select {
    max-height: 600px;
    overflow-y: auto;
}

.theme-dialog {
	.dialog-body {
		overflow: unset;
	}
}

.dialog-body-box {
	overflow-y: auto;
	background-color: #eee;
	max-width: 600px;
	max-height: 400px;
	.item {
		text-align: center;
		display: inline-block;
		background-color: #fff;
		margin: 3px;
		position: relative;
		.thumb {
			width: 100px;
			height: 100px;
			img {
				width: 100%;
				height: 100%;
			}
		}
		.name {
			width: 100px;
			overflow: hidden;
			color: #333;
			font-size: 12px;
			height: 16px;
		}
		&.selected {
			background-color: rgb(174, 255, 238);
			&::after {
				position: absolute;
				font-size: 100px;
				color: rgba(red, .3);
				font-family: "Font Awesome 5 Free";
				content: "\f00c";
				font-weight: 900;
				top: 10px;
				left: 0;
			}
		}
	}
	.dialog-pager {
		text-align: center;
	}
}

.custom-config-view {
    .multiple-box {
        .item {
            border:  1px dotted #ccc;
            margin-bottom: 5px;
            position: relative;
            .multiple-del-btn {
                position: absolute;
                top: 0;
                right: 0;
                width: 20px;
                height: 20px;
                border-radius: 50%;
                background-color: red;
                color: white;
                line-height: 20px;
                text-align: center;
            }
        }
    }
}

.custom-config-view {
    max-height: 80vh;
}